package com.pimwi.view.renderer
{

  import com.pimwi.control.event.ContactEvent;
  
  import flash.events.MouseEvent;

  public class DeleteContactItemRenderer extends DataGridItemRenderer
  {
    [Embed(source="assets/images/delete.png")]
    private var icon:Class;

    public function DeleteContactItemRenderer()
    {
      super();
      source = icon;
      toolTip = "Supprimer le contact";
      addEventListener(MouseEvent.CLICK, mouseClickHandler);
    }

    private function mouseClickHandler(event:MouseEvent):void
    {
      var evt:ContactEvent = new ContactEvent(ContactEvent.DELETE_CONTACT, listData.rowIndex, data, true, true);
      dispatchEvent(evt);
    }

  }
}